/*******************************************************************
 *
 * Copyright (C), 2021-2022, LS, All rights reserved.
 *
 * Author      : 
 * Create Time : 2021-09-22
 * Version     : v0.1
 * Description : 
 *******************************************************************/
#ifndef _HAL_BATTERY_H_
#define _HAL_BATTERY_H_
 
/*----------------------------Head file----------------------------*/
#include "error.h"
#include "types.h"
#include "stdint.h"
#include "stdbool.h"

/*----------------------------macro file---------------------------*/

/*----------------------------type define--------------------------*/
typedef enum {
    HAL_BAT_SUCCESS = 0,
    HAL_BAT_CONF_FAIL = 1,
    HAL_BAT_STOP_ABNORMAL = 2,
} hal_bat_err_t;

typedef void (*hal_charge_evt_cb_t)(bool charging);
typedef void (*hal_batt_adc_evt_cb_t)(uint32_t adc_value);

/*----------------------------var define---------------------------*/

/*-------------------------func declaration------------------------*/
extern bool hal_batt_charging_state_get(void);
extern bool hal_batt_full_charge_state_get(void);

extern int hal_batt_adc_measure(void);
extern int hal_batt_adc_init(hal_batt_adc_evt_cb_t cb);
extern void hal_batt_adc_deinit(void);
extern int hal_batt_charge_hw_init(hal_charge_evt_cb_t cb);
extern void hal_batt_charge_hw_deinit(void);

/*-----------------------------------------------------------------*/


#endif


